home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / COMP_ARC.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  59 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   COMP_ARC.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16.   This one was left laying around from some drawing program we built years
  17.   ago. I've not used it in those many years but it still works and may just
  18.   come in handy sometime. You send it 3 points and it will return all the
  19.   data you need to draw an arc connecting the 3 points. All the data is
  20.   fed into a PolygonTYPE and you can use CIRCLE to get the arc drawn.
  21.   The array that you use to send the points' data into the function with
  22.   HAS to be DIMed XY%(1,2) or greater. It just took too much code and time
  23.   to make the function work on far pointers.
  24.  
  25.   Try exchanging point 0 and point 2 data and watch what happens. It is
  26.   important to keep your points straight!
  27. $endif
  28.  
  29. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  30. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  31. $INCLUDE "DAS-NB03.INC"                     ' needs the math package
  32. $INCLUDE "DAS-NBV1.INC"                     '
  33. $INCLUDE "PUBLICS.INC"                      ' uses pPi# too
  34.                                             '
  35. CLS                                         '
  36. SCREEN 12                                   ' works better than text mode :)
  37. GraphicSETUP                                '
  38.                                             '
  39. DIM XY%(1,2), tP AS PolygonTYPE             ' dim our goodies
  40.                                             '
  41. XY%(0,0) = 100 : XY%(1,0) = 100             ' set the 3 points
  42. XY%(0,1) = 200 : XY%(1,1) =  50             '
  43. XY%(0,2) = 300 : XY%(1,2) = 100             '
  44.                                             '
  45. tP.Colour = 14                              ' yellow is a warm color
  46.  
  47. IF fComputeArc?( tP, XY%() ) THEN
  48.   CIRCLE (tP.X,tP.Y),tP.Radius,tP.Colour,tP.StartRad,tP.EndRad
  49. ELSE
  50.   PRINT "Can't draw that puppy!"
  51.   BEEP
  52. END IF
  53.  
  54. WHILE NOT INSTAT : WEND
  55. CLS
  56. SCREEN 0
  57.  
  58.  
  59.